package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了,请输入想要倒计时的时间，单位为秒");
        /**
         * 简易倒计时程序
         *
         */
        Scanner scanner=new Scanner(System.in);
        int time=scanner.nextInt();

        for ( int i=time ;time>0;time--){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(time);

        }
        System.out.println("程序结束啦");

//        while (time>0){
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//
//            }
//            time--;
//            System.out.println(time);
//        }
    }
}
